<?php
header('Content-Type:text/html; charset=windows-874');	

$qmr_check_appr_stu_request_dip = $_POST['qmr_check_appr_stu_request_dip'];

if($qmr_check_appr_stu_request_dip == "3") {

	// function date now
	$time = time();
	
	$day = date("d", $time);
	$month = date("m", $time);
	$year = date("Y", $time)+543;
	
	$dateCheckAppr = $day."/".$month."/".$year;
	// function date now
	
$re_diploma_id = $_POST['re_diploma_id'];	
$qmr_comment_stu_request_dip = "";
$qmr_check_stu_request_dip = $_POST['qmr_check_stu_request_dip'];

include 'connect.php';

$sqls = "use eiso ";
$sqls .= " update request_diploma set ";
$sqls .= " re_result_check = ".$qmr_check_appr_stu_request_dip." ";
$sqls .= " ,re_result_comment = '".$qmr_comment_stu_request_dip."' ";
$sqls .= " ,staff_id_appr = ".$qmr_check_stu_request_dip." ";
$sqls .= " ,date_check_appr = '".$dateCheckAppr."' ";
$sqls .= " ,check_step = ".$qmr_check_appr_stu_request_dip." ";
$sqls .= " where re_diploma_id = ".$re_diploma_id."";

$result = mssql_query($sqls);

} // check qmr Appr = 3

if($qmr_check_appr_stu_request_dip == "2") {

	// function date now
	$time = time();
	
	$day = date("d", $time);
	$month = date("m", $time);
	$year = date("Y", $time)+543;
	
	$dateCheckAppr = $day."/".$month."/".$year;
	// function date now
	
$re_diploma_id = $_POST['re_diploma_id'];	
$qmr_comment_stu_request_dip = iconv('utf-8', 'tis-620', $_POST['qmr_comment_stu_request_dip']);
$qmr_check_stu_request_dip = $_POST['qmr_check_stu_request_dip'];

include 'connect.php';

$sqls = "use eiso ";
$sqls .= " update request_diploma set ";
$sqls .= " re_result_check = ".$qmr_check_appr_stu_request_dip." ";
$sqls .= " ,re_result_comment = '".$qmr_comment_stu_request_dip."' ";
$sqls .= " ,staff_id_appr = ".$qmr_check_stu_request_dip." ";
$sqls .= " ,date_check_appr = '".$dateCheckAppr."' ";
$sqls .= " ,check_step = ".$qmr_check_appr_stu_request_dip." ";
$sqls .= " where re_diploma_id = ".$re_diploma_id."";

$result = mssql_query($sqls);

} // check qmr Appr = 2
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
</head>